package com.itheima.controller;

import com.itheima.pojo.Product;
import com.itheima.pojo.Result;
import com.itheima.pojo.ShelfCount;
import com.itheima.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
public class ProductTotal {
    @Autowired
    private ProductService productService;
    //上下架商品数量统计
    @GetMapping("/report/productUpOrDown")
    public Result publishTotal(){
        List<ShelfCount> shelfCount = productService.publishTotal();
        return Result.success(shelfCount);
    }
    @GetMapping("/report/productStatus")
    public Result verifyTotal(){
        List<ShelfCount> shelfCount = productService.verifyTotal();
        return Result.success(shelfCount);
    }
}
